-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci(e2e): Migrate tests to Jest #53702
Conversation
This PR modifies the release build for wpcom-block-editor To test your changes on WordPress.com, run To deploy your changes after merging, see the documentation: PCYsg-l4k-p2 |
Link to Calypso live: https://calypso.live?image=registry.a8c.com/calypso/app:build-9541 |
{ | ||
plugins: [ 'mocha' ], | ||
files: [ | ||
'test/e2e/specs/specs-jetpack/*', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable mocha
and disable jest
plugin & rules for these paths
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
85ed021
to
1ace87c
Compare
1ace87c
to
73128bb
Compare
@@ -19,7 +19,6 @@ export const buildHooks = ( displayNum ) => { | |||
let ffVideo; | |||
|
|||
const startVideoRecording = async () => { | |||
console.log( `Start video recording on port :${ displayNum }}` ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very noisy
@@ -0,0 +1,17 @@ | |||
const JestEnvironmentNode = require( 'jest-environment-node' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used to implement failfast (abort current spec if it fails, don't touch other specs). Inspired by jestjs/jest#6527 (comment)
9eb9116
to
28646d2
Compare
This PR modifies the release build for editing-toolkit To test your changes on WordPress.com, run To deploy your changes after merging, see the documentation: PCYsg-mMA-p2 |
The desktop tests failed, is that expected? |
11452d6
to
b75b7d6
Compare
dff57c5
to
99c3353
Compare
00fbbe4
to
a5b4965
Compare
Abandoned, we migrated Playwright tests instead. |
Changes proposed in this Pull Request
Migrate Calypso e2e tests to Jest.
Main differences
Jest and Mocha API are very similar. There are a few differences though:
this
inside the test. We can't store values there (eg: no morethis.driver = ...
).before
/after
hooks are namedbeforeAll
/afterAll
jest.setTimeout()
instead ofthis.timeout()
to set test timeoutsPros:
Seems to be a bit faster. I got a build in
3m:10s
, whiletrunk
is about3m:30s
. This doesn't even use Jest caching, so it may end up running in less than 3 minutes.jest-teamcity
reporter adds the test filename as part of the test name in TeamCity. This can help identify which tests is failing:Log are much easier to read, even when running multiple tests in parallel. It is easy to see what was the test suite, what step failed, the error and the stack trace:
Cons:
jest-teamcity
reporter adds the test filename as part of the test name... which means that renaming a file will erase the history of the test in TeamCity, as it will appear as a new test.Test that are in
specs/specs-calypso
but don't have the@parallel
tag will appear as disabled in TC UI.